﻿using NModbus;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RotovapPlatform.Domain.Equipment.Interfaces.Communication
{
	public interface IModbusTcpClient
	{
		IModbusMaster? Master { get; }
		bool IsConnected { get; }
		Task<bool> ConnectAsync();
		Task  DisconnectAsync();
		Task<bool[]> ReadDiscreteInputsAsync(byte slaveId, ushort startAddress, ushort length);
		Task<bool> WriteMultipleCoilsAsync(byte slaveId, ushort startAddress, bool[] values);
		Task<ushort[]> ReadInputRegistersAsync(byte slaveId, ushort startAddress, ushort length);
		Task<bool> WriteMultipleRegistersAsync(byte slaveId, ushort startAddress, ushort[] data);
	}
}

